import React from 'react';
import {connect} from 'dva';
import PropTypes from 'prop-types';
import {Button,Row,Col,Layout,Spin,Icon,Input,Card,message} from 'antd';
import style from '../../styles/TableCss.less';
import {Link} from 'dva/router'
// import reqwest from 'reqwest';
// import InStyle from '../../styles/Info.less'
// import SalerDirector from './SalerDirector.js'
// import EditableCell from '../../components/EditableCell.js'
import {reqwest_post} from '../../utils/Reqwest.js'
const {  Content, Footer } = Layout;
// const { RangePicker } = DatePicker;

class Login extends React.Component{
	constructor(props){
		super(props);
		this.state={
			data:[],
      list:[],
		}
	}
  
  componentWillMount(){
    // this.fetch(1);
    this.props.dispatch({type: 'orders/fetch',payload:{current: _current  ? this.props.location.query.page : 1, tab: ''}})
    // console.log(_current)

    if (JSON.parse(window.localStorage['setting']).role=='admin') {
      this.state._columns.splice(6,0,{
        title:"介绍人返利",
        dataIndex:'rebate'
      })
    }
    
  }
  handleTabClick(e){
    
    if(e * 1 === 2){
      this.props.dispatch({type: 'orders/fetch',payload:{current:1,tab:'&type=children'}})
    }else{
      this.props.dispatch({type: 'orders/fetch',payload:{current:1,tab:''}})
    }

    this.setState({tab:e});

  }
  componentWillUnmount() {
    // this.reqwest_server.abort();
  }
	render(){


    return(
      <Layout style={{background:'#fff',height:'100%'}}>

      </Layout> 
    )
	}
}

Login.contextTypes = {
  router: PropTypes.object
};


export default connect(({login}) => ({login}))(Login);
